/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package main;

import model.Customer;

/**
 *
 * @author Adminstrator
 */
public class ValidateInput {
    
    public static String ValidateMissingCustomer( Customer customer ){
        String Missing = "";
        
        if(customer.getName().isEmpty())Missing = Missing + "Naam niet ingevuld\n";
        else if(!customer.getName().matches("[a-zA-z]+([ '-][a-zA-Z]+)*"))Missing = Missing + "Naam verkeerd ingevuld\n";
        
        if(customer.getAddress().isEmpty())Missing = Missing + "Adres niet ingevuld\n";
        else if(!customer.getAddress().matches("[a-zA-Z]+[ ]+[0-9]*+[a-zA-Z]{0,1}"))Missing = Missing + "Adres verkeerd ingevuld\n";
        
        if(customer.getZipcode().isEmpty())Missing = Missing + "Postcode niet ingevuld\n";
        else if(!customer.getZipcode().matches("\\d{4}+[a-zA-Z]{2}"))Missing = Missing + "Postcode verkeerd ingevuld\n";
        
        if(customer.getCity().isEmpty())Missing = Missing + "Woonplaats niet ingevuld\n";
        else if(!customer.getCity().matches("[a-zA-Z]*"))Missing = Missing + "Woonplaats verkeerd ingevuld\n";
        
        return Missing;
               
    }
    
    
}
